import { Fragment } from 'react'
import { Button } from 'antd';
import { NewsPublish } from '@/components/Publish-manage/NewsPublish'
import { usePublish } from '@/utils/usePublish';

export default function Sunset() {
  // 调用自定义hook：usePublish，传入publishState值为3，接收函数调用的返回值
  const { newsList, handleDelete } = usePublish(3);

  return (
    <Fragment>
      <NewsPublish
        dataSource={newsList}
        button={id => <Button danger onClick={() => handleDelete(id)}>删除</Button>}
      />
    </Fragment>
  )
}